﻿using System;
using System.IO.IsolatedStorage;

namespace Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl
{
	public static class AppSettings
	{
		#region Constants
		private const String RI_OPT_IN = "AppSettings.RI_OPT_IN";
		#endregion

		#region Class variables
		public static bool RiOptIn
		{
			get
			{
				bool rioptin;
				if (IsolatedStorageSettings.ApplicationSettings.TryGetValue (RI_OPT_IN, out rioptin))
					return rioptin;

				// true by default
				return true;
			}
			set
			{
				IsolatedStorageSettings.ApplicationSettings[RI_OPT_IN] = value;
				IsolatedStorageSettings.ApplicationSettings.Save ();
			}
		}
		#endregion
	}
}
